Skip to content

feat: Support schema property examples #1165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dsuket
Copy link
Contributor

@dsuket dsuket commented Jun 12, 2025

Description

Support examples of schema property

Motivation and Context

To address Issue #1158, I need to organize the example-related parts.
This is the 4th(final) step toward that goal.

Please see below first.

How Has This Been Tested?

  • Pass npm run build
  • Pass npm run test
  • I went through the demo API and tests and confirmed that the examples are being displayed properly.

Screenshots (if appropriate)

example in request parameters schema

example in request parameters schema

examples in request parameters schema

examples in request parameters schema

example of properties in requestBody schema

example of properties in requestBody schema

examples of properties in requestBody schema

examples of properties in requestBody schema

example of schema properties in response

example of schema properties in response

examples of schema properties in response

examples of schema properties in response

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@dsuket dsuket marked this pull request as ready for review June 13, 2025 00:50
@dsuket dsuket changed the title Support schema property examples feat: Support schema property examples Jun 13, 2025
@sserrata
Copy link
Member

Hi @dsuket, can you rebase and resolve conflicts?

@sserrata sserrata self-assigned this Jun 27, 2025
@sserrata sserrata added the reviewing 👀 Undergoing manual audit to determine if issue should still be active label Jun 27, 2025
@dsuket
Copy link
Contributor Author

dsuket commented Jul 2, 2025

@sserrata Sorry for the late reply. I've updated the branch and confirmed that it's working as expected. Thank you.

Copy link

github-actions bot commented Jul 2, 2025

Visit the preview URL for this PR (updated for commit ae4a06d):

https://docusaurus-openapi-36b86--pr1165-1l5b7pz6.web.app

(expires Fri, 01 Aug 2025 02:44:59 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

Copy link

github-actions bot commented Jul 2, 2025

Visual Diff Summary

View Logs

Total: 77, Matches: 58, Diffs: 19, Skipped: 0

Page Status
/tests/all-of-inherits-parent-required diff
/tests/all-of-with-nested-all-of diff
/tests/allof-variations-api diff
/tests/anyof-variations-api diff
/tests/get-document-with-header-parameter diff
/tests/get-entities-by-multiple-status diff
/tests/get-entities-by-status diff
/tests/get-item-by-id-label-style diff
/tests/get-product-by-code-matrix-style diff
/tests/get-user-by-id diff
/tests/get-user-preferences-with-cookie-parameter diff
/tests/get-with-cookie-parameters diff
/tests/get-with-header-parameters diff
/tests/object-with-boolean-additional-properties diff
/tests/object-with-schema-defined-additional-properties diff
/tests/object-with-typed-additional-properties diff
/tests/object-without-any-additional-properties diff
/tests/oneof-variations-api diff
/tests/search-with-various-query-parameter-styles diff

@sserrata
Copy link
Member

sserrata commented Jul 2, 2025

Hi @dsuket, similar to #1164, both the autogenerated and static example/examples are already rendered in the API Explorer component (for requests). I'm not sure we necessarily want to duplicate that in the main doc panel. That aside, I do think we should merge the enhancements made to property examples. Since we're not yet decided would it be too much to create a separate PR for the property example/examples support?

@dsuket
Copy link
Contributor Author

dsuket commented Jul 3, 2025

@sserrata Thank you for your feedback. As I mentioned here, schema examples are not displayed in the API Explorer, so I think it makes sense to display them in main doc panel.

Also, I'll try to see if I can handle the property examples in a separate PR.
Thank you.

@dsuket
Copy link
Contributor Author

dsuket commented Jul 7, 2025

I submitted a PR for the extracted property examples in #1198. I'll close this one.

@dsuket dsuket closed this Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewing 👀 Undergoing manual audit to determine if issue should still be active
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants